//配置路由相关信息
import Vue from 'vue'
import Router from 'vue-router'
import Home from '../components/Home.vue'
import About from '../components/About.vue'
import User from '../components/User.vue'
import HomeMessage from '../components/HomeMessage.vue'
import HomeNews from '../components/HomeNews.vue'
import Profile from '../components/Profile.vue'
/* const HomeMessage = () => import ('../components/HomeMessage')
const HomeNews = () => import ('../conponents/HomeNews') */
Vue.use(Router)//使用路由插件
/* const routes = [
	{
		
	}
]
const router = new VueRouter({
	routes
}) 

const Home = () => import ('../components/Home')
const About = () => import ('../components/About')
const User = () => import ('../components/User')
// 懒加载


*/

export default new Router({
  routes: [
	  {
		  path:'',//缺省路由  默认显示首页
		  redirect:'/Home'//重定向
		  
	  },
    {
      path: '/Home',
      name: 'Home',
      component: Home,
	   meta:{
		  title:'首页' 
	   },
	  children:[//添加子组件
		{
			path:'',
			redirect:'message'//添加默认路由 就是就显示的页面内容
		},
		{
			path:'news',
			component:HomeNews 
		 },
		{
			path:'message',
			component:HomeMessage
		}
		
		  
	  ]
    },
	{
		path: '/About',
		name: 'About',
		component: About,
		meta:{
			title:'关于'
		}
	},
	{
		path:'/User/:names',
		name:'User',
		component:User,
		meta:{
			title:'用户'
		}
	},
	{
		path:'/Profile',
		name:'Profile',
		component:Profile,
		meta:{
			title:'档案'
		}
	}
  ]
})
